<!-- extend base layout -->
{% extends "base.html" %}
{% block css %}
    <link href="/isard-admin/static/vendor/fancytree/dist/skin-win8/ui.fancytree.css" rel="stylesheet">
    <!-- Ion.RangeSlider -->
    <link href="/isard-admin/vendors/normalize-css/normalize.css" rel="stylesheet">
    <link href="/isard-admin/vendors/ion.rangeSlider/css/ion.rangeSlider.css" rel="stylesheet">
    <link href="/isard-admin/vendors/ion.rangeSlider/css/ion.rangeSlider.skinFlat.css" rel="stylesheet">
        <!-- Switchery -->
    <link href="/isard-admin/vendors/switchery/dist/switchery.min.css" rel="stylesheet">
{% endblock %}
{% block content %}

<div class="row">
   <div class="col-md-12 col-sm-12 col-xs-12">
      <div class="x_panel">
         <div class="x_title">
            <h3><i class="fa fa-{{icon}}"></i> 管理桌面</h3>
            <ul class="nav navbar-right panel_toolbox">
               {% if nav == "Desktops" %}
                  <li>
                     <a class="btn-add-desktop">
                        <span style="color: #5499c7; ">
                           <i class="fa fa-plus"></i>
                           批量修改桌面</span>
                     </a>
                  </li>
               {% endif %}
               {% if nav == "Templates" %}
                  <li>
                     <a class="btn-disabled" view="false" >

                        <span style="color: #5499c7; display: none;" id="view-disabled">
                           <i class="fa fa-eye"></i>
                           禁用查看</span>

                           <span style="color: #5499c7;" id="hide-disabled">
                              <i class="fa fa-eye-slash"></i>
                              禁用隐藏</span>
                        </a>
                     </a>
                  </li>
               {% endif %}

               <!--<li>
                  <a class="btn btn-app add-new-media" style="background-color:#F5FFDC;">
                     <i class="fa fa-circle-o"></i> New from ISO
                  </a>
               </li>-->
               <!--<li>
                  <a class="btn btn-app add-new-virtbuilder"  style="background-color:#F5FFDC;">
                     <i class="fa fa-wrench"></i> New From Builder
                  </a>
               </li>-->
            </ul>
            <div class="clearfix"></div>
         </div>
         <div class="x_content">
            <p class="text-muted font-13 m-b-30"></p>
            <div id="global_actions" style="display:none; width: 15cm;">
               <label class="control-label col-md-3 col-sm-3 col-xs-12 pull-left" for="mactions">
                  <h4>
                     全局操作:
                  </h4>
               </label>
               <div class="col-md-5 col-sm-5 col-xs-12" style="margin-bottom: 20px;">
                  <select class="form-control" id="mactions" name="mactions" >
                     <option value="none">选择操作</option>
                     <option value="soft_toggle">软切换启动/关闭状态</option>
                     <option value="toggle">切换启动/停止状态</option>
                     <!-- <option value="stop_noviewer">Stop no viewers</option> -->
                     <option value="shutting_down">软关机</option>
                     <option value="stopping">关机</option>
                     <option value="force_failed">改变失败状态</option>
                     <option value="delete">删除</option>
                     <option value="starting_paused">开始暂停（检查状态）</option>
                     <option value="remove_forced_hyper">删除强制关机服务器</option>
                     <option value="remove_favourite_hyper">删除喜好的服务器</option>
                  </select>
               </div>
            </div>
            <div id="tableDiv"></div>
               <table id="domains" class="table">
                  <thead>
                     <tr>
                        <th rowspan="2"></th>
                        <th rowspan="2">图标</th>
                        <th rowspan="2">名称</th>
                        <th rowspan="2">说明</th>
                        {% if nav == "Desktops" %}
                           <th rowspan="2">状态</th>
                           <th rowspan="2">操作</th>
                           <th rowspan="2">RAM(GB)</th>
                           <th rowspan="2">vCPUs</th>
                        {% endif %}
                        <th rowspan="2">用户</th>
                        <th rowspan="2">类别</th>
                        <th rowspan="2">组</th>
                        {% if nav == "Desktops" %}
                           <th rowspan="2">Server</th>
                        {% endif %}
                        {% if nav == "Templates" %}
                           <th colspan="2" class="text-center">服务器集群</th>
                        {% elif nav == "Desktops" %}
                           <th colspan="3" class="text-center">服务器集群</th>
                        {% endif %}
                        {% if nav!="Desktops" %}
                           <th rowspan="2">启用</th>
                           <th rowspan="2">衍生</th>
                           <th rowspan="2">共享</th>
                        {% endif %}
                        <th rowspan="2">最后访问</th>
                        {% if nav == "Desktops" %}
                           <th rowspan="2">选择</th>
                        {% endif %}
                        <th rowspan="2">ID</th>
                     </tr>
                     <tr>
                        {% if nav == "Desktops" %}
                           <th>开始</th>
                        {% endif %}
                        <th>喜好</th>
                        <th>强制</th>
                     </tr>
                  </thead>
                  <tbody>
                  </tbody>
                  <tfoot>
                     <tr>
                        <th></th>
                        <th>图标</th>
                        <th>名称</th>
                        <th>说明</th>
                        {% if nav == "Desktops" %}
                           <th>状态</th>
                           <th>操作</th>
                           <th>内存(GB)</th>
                           <th>vCPUs</th>
                        {% endif %}
                        <th>用户</th>
                        <th>分类</th>
                        <th>用户组</th>
                        {% if nav == "Desktops" %}
                           <th>服务器</th>
                        {% endif %}
                        {% if nav == "Desktops" %}
                           <th>开启服务器</th>
                        {% endif %}
                        <th>喜好服务器</th>
                        <th>强制服务器</th>
                        {% if nav!="Desktops" %}
                           <th>启用</th>
                           <th>衍生</th>
                           <th>共享</th>
                        {% endif %}
                        <th>最后访问</th>
                        {% if nav == "Desktops" %}
                           <th>选择</th>
                        {% endif %}
                        <th>Id</th>
                     </tr>
                  </tfoot>
               </table>
            </div>
         </div>
      </div>
   </div>
   {% include '/admin/pages/domains_modals.html' %}
   {% include '/pages/desktops_modals.html' %}
   {% include '/pages/desktops_detail.html' %}
   {% include 'admin/pages/templates_detail.html' %}
   {% include '/pages/desktops_viewers.html' %}
   {% include '/snippets/alloweds_form.html' %}
</div>

{% endblock %}

{% block pagescript %}
   <!-- Ion.RangeSlider -->
   <script src="/isard-admin/vendors/ion.rangeSlider/js/ion.rangeSlider.min.js"></script>
   <!-- iCheck -->
   <script src="/isard-admin/vendors/iCheck/icheck.min.js"></script> 
   <!-- Switchery -->
   <script src="/isard-admin/vendors/switchery/dist/switchery.min.js"></script>
   <!-- Isard restful ajax calls -->
   <script src="/isard-admin/static/js/restful.js"></script>
   <!-- Spice viewer -->
   <script src="/isard-admin/static/js/viewer.js"></script> 
   <!-- Domains sse & hardware subtables -->  
   <script src="/isard-admin/static/js/snippets/desktop_add.js"></script> 
   <script src="/isard-admin/static/admin/js/domains.js"></script>
   <!--<script src="/isard-admin/static/admin/js/domains_subtables.js"></script>-->
{% endblock %}
